🎖️GitЯра🎖️
.github/agents/speckit.git.validate.agent.md gh-readonly-queue/main/pr-5954-e8fb0d3632384411e1ab015c806a2ae3631fcc42 (3b09b6ac) Text, 2.11 KB
description: Validate current branch follows feature branch naming conventions
<!-- Extension: git -->
<!-- Config: .specify/extensions/git/ -->
Validate Feature Branch
Validate that the current Git branch follows the expected feature branch naming conventions.
Prerequisites
• Check if Git is available by running T383838git rev-parse --is-inside-work-tree 2>/dev/null
• If Git is not available, output a warning and skip validation:
T282828
[specify] Warning: Git repository not detected; skipped branch validation
Validation Rules
Get the current branch name:
T282828
git rev-parse --abbrev-ref HEAD
The branch name must match one of these patterns:
1. Sequential: T383838^[0-9]{3,}- (e.g., T383838001-feature-name, T383838042-fix-bug, T3838381000-big-feature)
2. Timestamp: T383838^[0-9]{8}-[0-9]{6}- (e.g., T38383820260319-143022-feature-name)
3. Conventional prefix: T383838^(feat|fix|chore|docs|build|ci|refactor|test|deps)/ (e.g., T383838feat/add-node-filter, T383838fix/ble-reconnect)
Execution
If on a feature branch (matches either pattern):
• Output: T383838✓ On feature branch: <branch-name>
• For sequential/timestamp branches, check if the corresponding spec directory exists under T383838specs/:
• For sequential branches, look for T383838specs/<prefix>-* where prefix matches the numeric portion
• For timestamp branches, look for T383838specs/<prefix>-* where prefix matches the T383838YYYYMMDD-HHMMSS portion
• For conventional prefix branches, skip spec directory lookup (not spec-driven)
• If spec directory exists: T383838✓ Spec directory found: <path>
• If spec directory missing: T383838⚠ No spec directory found for prefix <prefix>
If NOT on a feature branch:
• Output: T383838✗ Not on a feature branch. Current branch: <branch-name>
• Output: T383838Feature branches should be named like: 001-feature-name, feat/feature-name, or 20260319-143022-feature-name
Graceful Degradation
If Git is not installed or the directory is not a Git repository:
• Check the T383838SPECIFY_FEATURE environment variable as a fallback
• If set, validate that value against the naming patterns
• If not set, skip validation with a warning
Served by rngit 1.5.2 - Generated in 0.07s